/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.yaps.petstore.service;

import com.yaps.petstore.dao.CustomerDAO;
import com.yaps.petstore.entity.customer.Address;
import com.yaps.petstore.entity.customer.Customer;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 *
 * @author pfa
 */

@Service("AccountService")
public class AccountService  implements IAccountService {

    @Autowired
    private CustomerDAO customerDAO;

    @Override
    public Customer authenticate(String login, String password) {
        return customerDAO.authenticate(login, password);
    }

    @Override
    public Customer createCustomer(Customer customer, Address homeAddress) {
        return customerDAO.createCustomer(customer, homeAddress);
    }

    @Override
    public void deleteCustomer(Customer customer) {
       customerDAO.deleteCustomer(customer);
    }

    @Override
    public Customer findCustomer(Long customerId) {
        return customerDAO.findCustomer(customerId);
    }

    @Override
    public List<Customer> findCustomers() {
        return customerDAO.findCustomers();
              
    }

    @Override
    public Customer updateCustomer(Customer customer, Address homeAddress) {
        return customerDAO.updateCustomer(customer, homeAddress);
    }

    
  

    
}
